package com.itlaobing.dispatch.forward;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/guo/xiang")
public class GuoXiangServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.log("峨眉郭女侠");

        Object values = request.getAttribute("name");// 从 请求对象 中获取 指定名称 的 属性值
        this.log( "" +values);

        response.setContentType("text/html ;charset=utf-8");
        PrintWriter out = response.getWriter();
        out.println("<div align=center>");
        out.println("我已有心上人");
        out.println("</div>");
    }
}